package org.team4.web.ajax;

import java.util.List;

import org.jxc.domain.Customer;
import org.jxc.domain.Supplier;
import org.jxc.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.opensymphony.xwork2.Action;

@Controller
@Scope("prototype")
public class CustomerAjaxAction {

	@Autowired
	private CustomerService customerService;

	private List<Customer> customerList;

	private String ids;

	/**
	 * 根据条件获取人员
	 * 
	 * @return
	 * @throws Exception
	 */
	public String listCustomerByCondition() throws Exception {
		customerList = customerService.findByOperator();
		return Action.SUCCESS;
	}

	public String findCustomerByIds() throws Exception {
		customerList = customerService.findCustomerByIds(ids);
		return Action.SUCCESS;
	}

	public String getIds() {
		return ids;
	}

	public void setIds(String ids) {
		this.ids = ids;
	}

	public List<Customer> getCustomerList() {
		return customerList;
	}

	public void setCustomerList(List<Customer> customerList) {
		this.customerList = customerList;
	}
}